Combo Box resizing demonstrations...

By: Dan Hinrichs
    Electro-Craft
    70254.3513@compuserve.com
    hinrichs@alaska.net

Date: June 22,1997

Environment:  VB3

The associated combo box demonstrations were done to assist myself
in getting a smaller height on combo boxes.  We have several projects
which need the smaller height.

The code ain't pretty, as it was inhouse to hammer through the issue.

Two combo boxes are worked on in the demonstration.

On the left is Combo1.  You can use all sorts of API calls for the edit box height, dropdown list box line heights, etc... and even set them yourself.

When Combo1 is set for EDIT BOX HEIGHT of zero, it moves to assosociate it with a text box and another picture controller.  I found that this did not work well, due to focus problems, keyboard routines from hell, etc. etc.  Not to mention the list box can be orphaned if an API call makes the listbox portion visible and you go to another form.  In the end, I found that the BEST use of any of these calls was when the edit box was resized to just show the font ( around 17 or 18).  I did not play with different resolutions, so you may have to take into account the different displays that users may use.  I did not calculate it, but I bet that the return value and setting value for the edit box is in pixels.... whereas most forms are in twips... you do the math !!!!... remember, we were just trying something here...

The Combo3 on the right half of the form shows how easy it is just to put the combo within a picture box. Just for fun, I hid the drop down button, and created my own.  I liked this the best.  It was easier, with only one API call which just checked to see if the dropdown list was visible or not. An image box was used, because if you remember, images do not take focus, and when a combo box has the focus and it's dropdown list is showing, any focus taken away from the combo will close up the dropdown list.  The image control allowed custom buttons without taking focus away.

Use this for your own purposes to assist you in working with combos....

*****************************************************************
Dislaimer:
There are no warranties... and do not call or write about problems.
You are free to distribute ONLY if you include all files.

*****************************************************************

End of file.   